#ifndef _BLUREFFECT_H_
#define _BLUREFFECT_H_

#include <windows.h>
#include <xnamath.h>
#include <d3d11.h>
#include <d3dx11async.h>
#include <fstream>
#include <Effect11/d3dx11effect.h>

enum BlurOrientation { HorizontalBlur, VerticalBlur };

class BlurEffect
{
public:

	void Initialize(BlurOrientation pOrientation);
	void Uninit();

	void Render(int indexCount);

	void SetViewWidth(float pWidth);
	void SetTextureToBlur(ID3D11ShaderResourceView *pTexture);
	void SetTransformsMatrices(const XMFLOAT4X4 &pWorldMatrix, const XMFLOAT4X4 &pViewMatrix, const XMFLOAT4X4 &pProjectionMatrix);
protected:
	void InitInputLayout();

	ID3D11Device* mDevice;
	ID3D11DeviceContext* mDeviceContext;
	ID3DX11Effect* mEffect;
	ID3DX11EffectTechnique* mTechnique;
	ID3D11InputLayout* mInputLayout;

	ID3DX11EffectMatrixVariable* mFxMatrixWorld;
	ID3DX11EffectMatrixVariable* mFxMatrixView;
	ID3DX11EffectMatrixVariable* mFxMatrixProjection;
	ID3DX11EffectShaderResourceVariable* mFxTexture;
	ID3DX11EffectScalarVariable* mFxViewWidth;
};

#endif